﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BibliotecaProjeto.persistencia;

namespace ProjetoGui
{
    public partial class menu : Form
    {
        public menu()
        {
            InitializeComponent();
        }

        private void btnUsuario_Click(object sender, EventArgs e)
        {
            cadUser user = new cadUser();
            user.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            cadFunc func = new cadFunc();
            func.ShowDialog();
        }

        private void btnEquip_Click(object sender, EventArgs e)
        {
            cadEquip equip = new cadEquip();
            equip.ShowDialog();
        }

        private void btnAluguel_Click(object sender, EventArgs e)
        {
            realAluguel alug = new realAluguel();
            alug.ShowDialog();
        }

        private void btnLista_Click(object sender, EventArgs e)
        {
            pesquisar pesq = new pesquisar();
            pesq.ShowDialog();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            ConexaoSqlServer conBD = new ConexaoSqlServer();

            try
            {
                conBD.abrirConexao();
                MessageBox.Show("Testando conexão, está ok");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro de conexao" + ex.Message);
            }
            finally
            {
                conBD.fecharConexao(); ;
            }
        }

        private void btnUsuarioSistema_Click(object sender, EventArgs e)
        {
            cadAtend cadAtend = new cadAtend();
            cadAtend.ShowDialog();
        }
    }
}